package com.ruoyi.flow.common.tools.mediaconverter.converter.reflections.scanners;

import java.lang.reflect.Member;
import java.util.List;

import com.ruoyi.flow.common.tools.mediaconverter.converter.reflections.util.JavaReflectionUtils;

@SuppressWarnings({"unchecked"})
/** scans for method's annotations */
public class MethodAnnotationsScanner extends AbstractScanner {
    public void scan(final Class cls) {
        for (Member method : JavaReflectionUtils.getMethods(cls)) {
            for (String methodAnnotation : (List<String>) JavaReflectionUtils.getMethodAnnotationNames(method)) {
                if (acceptResult(methodAnnotation)) {
                    getStore().put(methodAnnotation, JavaReflectionUtils.getMethodFullKey(cls, method));
                }
            }
        }
    }
}
